package com.winit.agent.service;


import com.winit.agent.model.UCloudAgent;
import com.winit.agent.repository.UCloudAgentRespository;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.util.StringUtils;

@Component
public class UCloudAgentService {


    private static Logger log = LoggerFactory.getLogger(UCloudAgentService.class);


    @Autowired
    private UCloudAgentRespository respository;

    public void saveAgent(UCloudAgent uCloudAgent){
        String id = uCloudAgent.getId();
        if(StringUtils.isEmpty(id)){
            respository.save(uCloudAgent);
        }
    }


}
